package cn.chjyj.sxzsys.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

@Controller
public class IndexController {
    @ResponseBody
    @GetMapping("/")
    public String home(){
        long timeStamp  = System.currentTimeMillis();
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return "it's work!"+sdf.format(new Date(timeStamp));
        //return "It's works."+sdf.format(new Date(Long.parseLong(String.valueOf(timeStamp))));
    }
    @GetMapping("/index")
    public String index(){
        return "index";
    }
}
